Show AllShow All

MATCH

See Also

Returns the relative position of an item in an array that matches a specified value in a specified order. Use MATCH instead of one of the LOOKUP functions when you need the position of an item in a range instead of the item itself.

Syntax

MATCH(lookup_value,lookup_array,match_type)

Lookup_value    is the value you use to find the value you want in a table.

Lookup_array    is a contiguous range of cells containing possible lookup values. Lookup_array must be an array or an array reference.

Match_type    is the number -1, 0, or 1. Match_type specifies how Microsoft Excel matches lookup_value with values in lookup_array.

Remarks

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

 
1
2
3
4
5
A B
Product Count
Bananas 25
Oranges 38
Apples 40
Pears 41
Formula Description (Result)
=MATCH(39,B2:B5,1) Because there is not an exact match, the position of the next lowest value (38) in the range B2:B5 is returned. (2)
=MATCH(41,B2:B5,0) The position of 41 in the range B2:B5. (4)
=MATCH(40,B2:B5,-1) Returns an error because the range B2:B5 is not in descending order. (#N/A)